using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableWantedLevelDao:DaoBase<TableWantedLevel>
    {
        public override void AddPrimaryIndex(TableWantedLevel model)
        {
            cachePrimary[model.WantedID.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableWantedLevel.txt";
        }

        protected override TableWantedLevel ParseRowData(string[] rowData)
        {
            TableWantedLevel data = new TableWantedLevel();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.WantedID = 0;
            }
            else
            {
                data.WantedID = int.Parse(rowData[0]);
            }

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.Level = 0;
            }
            else
            {
                data.Level = int.Parse(rowData[1]);
            }

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.Difficulty = 0;
            }
            else
            {
                data.Difficulty = int.Parse(rowData[2]);
            }
			data.Name = rowData [3];
			data.FightRoomId = rowData [4];

            return data;
        }



    }

}
